import {
  IsString,
  IsBoolean,
  IsNumber,
  IsOptional,
  IsDateString,
} from 'class-validator';
import { ApiPropertyOptional } from '@nestjs/swagger';

export class UpdateTodoDto {
  @ApiPropertyOptional({
    description: '任务标题',
    example: '完成项目文档（已更新）',
  })
  @IsOptional()
  @IsString()
  title?: string;

  @ApiPropertyOptional({
    description: '完成状态',
    example: true,
  })
  @IsOptional()
  @IsBoolean()
  completed?: boolean;

  @ApiPropertyOptional({
    description: '负责人ID',
    example: 2,
  })
  @IsOptional()
  @IsNumber()
  assigneeId?: number;

  @ApiPropertyOptional({
    description: '父任务ID',
    example: 1,
  })
  @IsOptional()
  @IsNumber()
  parentId?: number;

  @ApiPropertyOptional({
    description: '团队ID',
    example: 1,
  })
  @IsOptional()
  @IsNumber()
  teamId?: number;

  @ApiPropertyOptional({
    description: '预计完成时间',
    example: '2024-12-31T23:59:59.000Z',
  })
  @IsOptional()
  @IsDateString()
  dueDate?: string;
}
